import {
    Button,
    Card,
    Checkbox,
    Col,
    DatePicker,
    Form,
    Input,
    InputNumber,
    Popover,
    Row,
    Select,
    Space,
    Table,
    Tabs
} from "antd";
import React from "react";
import BaseComponent from "../../redare/components/BaseComponent";
import OnlFormHeadGrid from "./OnlFormHeadGrid";
import {PlusOutlined, EllipsisOutlined} from '@ant-design/icons';
import {message} from 'antd';
import {MenuOutlined} from '@ant-design/icons';
import DndGrid from "../../redare/components/grid/DndGrid";
import {arrayMoveImmutable} from "array-move";
import {Link} from "react-router-dom";
import OnlFormFieldPresenter from "../../.gen/presenter/OnlFormFieldPresenter";


export default class OnlFormHeadForm extends BaseComponent {

    formRef = React.createRef();

    constructor(props) {
        super(props);
        this._form.extraValue = {};
        this.presenter = new OnlFormFieldPresenter(this);
        this.state = {
            fields: [],
            tableType:'0'
        }
    }


    validateFormFields() {
        return new Promise((resolve, reject) => {
            this.formRef.current.validateFields().then((values) => {
                let resultValues = {...values, ...this._form.extraValue}
                resultValues.formFields = this.state.fields;
                resolve(resultValues);
            }).catch((errorInfo) => {
                reject(errorInfo);
            });
        });
    }

    setFormData(data) {
        if (this.formRef.current && data) {
            data.tableType = data.tableType + '';
            this.formRef.current.setFieldsValue(data);
            if (data.fields) {
                data.fields.forEach((value, index) => {
                    value.index = index;
                })
                this.setState({fields: data.fields,tableType:data.tableType})
                if (this.grid) {
                    this.grid.setData(data.fields);
                }
            }
        }
    }

    resetFormFields() {
        if (this.formRef.current) {
            this.formRef.current.resetFields();
        }
    }

    _delItem(record) {
        if (record.id) {
            this.confirm('确定删除吗?', () => {
                this.presenter.deleteOnlFormField({id: record.id}, null, () => {
                    let {fields} = this.state;
                    let newData = [];
                    fields.forEach((item, index) => {
                        if (item.id != record.id) {
                            newData.push(item);
                        }
                    })
                    this.setState({fields: newData})
                    if (this.grid) {
                        this.grid.setData(newData);
                    }
                })
            })
        } else {
            let {fields} = this.state;
            let newData = [];
            fields.forEach((item, index) => {
                if (item.index != record.index) {
                    newData.push(item);
                }
            })
            this.setState({fields: newData})
            if (this.grid) {
                this.grid.setData(newData);
            }
        }
    }

    checkBoxChange(index, field, e) {
        const value = e.target.checked;
        let {fields} = this.state;
        fields[index]['' + field] = value;
        this.setState({fields})
        if (this.grid) {
            this.grid.setData(fields);
        }
    }

    inputChange(index, field, e) {
        const {value} = e.target;
        let {fields} = this.state;
        fields[index]['' + field] = value;
        this.setState({fields})
        if (this.grid) {
            this.grid.setData(fields);
        }
    }

    onGridInputChange(index, field, e) {
        const {value} = e.target;
        let {fields} = this.state;
        fields[index]['' + field] = value;
        this.setState({fields})
        if (this.grid) {
            this.grid.setData(fields);
        }
    }

    onGridNumberInputChange(index, field, value) {
        let {fields} = this.state;
        fields[index]['' + field] = value;
        this.setState({fields})
        if (this.grid) {
            this.grid.setData(fields);
        }
    }

    addFieldsItem = () => {

        let {fields} = this.state;
        let data = [...fields, {'index': fields.length}];
        this.setState({fields: data})
        if (this.grid) {
            this.grid.setData(data);
        }
    }

    handleSelectChange(index, field, value) {
        let {fields} = this.state;
        fields[index]['' + field] = value;
        this.setState({fields})
        if (this.grid) {
            this.grid.setData(fields);
        }
    }

    onGridRowMove = (dragRecord, hoverRecord) => {
        let {fields} = this.state;
        let dragIndex = dragRecord.index;
        let hoverIndex = hoverRecord.index;
        if (dragIndex !== hoverIndex) {
            const newData = arrayMoveImmutable([].concat(fields), dragIndex, hoverIndex).filter(el => !!el);
            newData.forEach((value, index) => {
                value.index = index;
            })
            this.setState({fields: newData});
            if (this.grid) {
                this.grid.setData(newData);
            }
        }
    }

    render() {
        let {fields,tableType} = this.state;
        return (
            <div>
                <Form labelCol={{span: 6}} ref={this.formRef}>
                    <Row gutter={[12, 12]}>
                        <Col sm={24} md={24} lg={12} xl={8}>
                            <Form.Item
                                name={"tableName"}
                                label="表名"
                                rules={[{required: true, message: '请输入表名'}]}
                            >
                                <Input placeholder="请输入表名" maxLength="50"/>
                            </Form.Item>
                        </Col>
                        <Col sm={24} md={24} lg={12} xl={8}>
                            <Form.Item
                                name={"comment"}
                                label="表说明"
                                rules={[{required: true, message: '请输入表说明'}]}
                            >
                                <Input placeholder="请输入表说明" maxLength="200"/>
                            </Form.Item>
                        </Col>
                        <Col sm={24} md={24} lg={12} xl={8}>
                            <Form.Item
                                name={"subPath"}
                                label="子目录"
                                rules={[{required: true, message: '请输入目录'}]}
                            >
                                <Input placeholder="请输入目录" maxLength="200"/>
                            </Form.Item>
                        </Col>
                        <Col sm={24} md={24} lg={12} xl={8}>
                            <Form.Item
                                name={"tableType"}
                                label="表类型"
                                rules={[{required: true, message: '请选择表类型'}]}>
                                <Select
                                    style={{width: '100%'}}>
                                    <Select.Option value="0">单表</Select.Option>
                                    <Select.Option value="1">主表</Select.Option>
                                    <Select.Option value="2">附表</Select.Option>
                                </Select>
                            </Form.Item>
                        </Col>

                        <Col sm={24} md={24} lg={12} xl={8}>
                            <Form.Item
                                name={"formColumnCount"}
                                label="表单风格">
                                <Select
                                    defaultValue={3}
                                    style={{width: '100%'}}>
                                    <Select.Option value={1}>一列</Select.Option>
                                    <Select.Option value={2}>两列</Select.Option>
                                    <Select.Option value={3}>三列</Select.Option>
                                    <Select.Option value={4}>四列</Select.Option>
                                </Select>
                            </Form.Item>
                        </Col>
                        {/*<Col sm={24} md={24} lg={12} xl={8}>*/}
                        {/*    <Form.Item*/}
                        {/*        name={"isPage"}*/}
                        {/*        label="是否分页"*/}
                        {/*        rules={[{required: true, message: '请选择是否分页'}]}*/}
                        {/*    >*/}
                        {/*        <Select*/}
                        {/*            style={{width: '100%'}}>*/}
                        {/*            <Select.Option value="1">是</Select.Option>*/}
                        {/*            <Select.Option value="2">否</Select.Option>*/}
                        {/*        </Select>*/}
                        {/*    </Form.Item>*/}
                        {/*</Col>*/}

                        {/*<Col sm={24} md={24} lg={12} xl={8}>*/}
                        {/*    <Form.Item*/}
                        {/*        name={"themeTemplate"}*/}
                        {/*        label="主题模板"*/}
                        {/*    >*/}
                        {/*        <Input placeholder="请输入主题模板" maxLength="50"/>*/}
                        {/*    </Form.Item>*/}
                        {/*</Col>*/}
                        <Col sm={24} md={24} lg={12} xl={8}>
                            <Form.Item
                                name={"exportExcel"}
                                valuePropName="checked"
                                label="支持导出"
                            >
                                <Checkbox/>
                            </Form.Item>
                        </Col>
                        <Col sm={24} md={24} lg={12} xl={8}>
                            <Form.Item
                                name={"imported"}
                                valuePropName="checked"
                                label="支持导入"
                            >
                                <Checkbox/>
                            </Form.Item>
                        </Col>
                        <Col sm={24} md={24} lg={12} xl={8}>
                            <Form.Item
                                name={"modalForm"}
                                valuePropName="checked"
                                label="modal表单"
                            >
                                <Checkbox/>
                            </Form.Item>
                        </Col>
                        <Col sm={24} md={24} lg={12} xl={8}>
                            <Form.Item
                                name={"tree"}
                                valuePropName="checked"
                                label="是否是树">
                                <Checkbox onChange={(e) => {
                                    this.setState({isTree: e.target.checked})
                                }}/>
                            </Form.Item>
                        </Col>
                        {(this.state.isTree && this.state.isTree == true) ?
                            <>
                                <Col sm={24} md={24} lg={12} xl={8}>
                                    <Form.Item
                                        name={"treeParentIdField"}
                                        label="树形表单父id">
                                        <Input placeholder="请输入树形表单父id" maxLength="50"/>
                                    </Form.Item>
                                </Col>
                                <Col sm={24} md={24} lg={12} xl={8}>
                                    <Form.Item
                                        name={"treeFieldname"}
                                        label="树展开列字段">
                                        <Input placeholder="请输入树开表单列字段" maxLength="50"/>
                                    </Form.Item>
                                </Col>
                            </> : null}
                    </Row>
                    {tableType&&tableType==='1'?<Row>
                        <Col span={24}>
                            <Form.Item
                                labelCol={6}
                                name={"subTableStr"}
                                label="附表"
                            >
                                <Input readOnly={true} disabled={true}/>
                            </Form.Item>
                        </Col>
                    </Row>:null}
                </Form>

                <Tabs>
                    <Tabs.TabPane tab="数据库属性" key="1">
                        <div>
                            <Button key="button" icon={<PlusOutlined/>} type="primary" onClick={this.addFieldsItem}>
                                新建
                            </Button>
                            <DndGrid
                                size="small"
                                scroll={{y: '25vh'}}
                                search={false}
                                bordered={true}
                                _showPage={false}
                                columns={this.columns}
                                ref={((o) => {
                                    this.grid = o
                                })}
                                rowKey="index"
                                _onRowMove={this.onGridRowMove}
                            />
                        </div>
                    </Tabs.TabPane>
                    <Tabs.TabPane tab="页面属性" key="2">
                        <Table
                            rowKey="index"
                            search={false}
                            scroll={{y: '25vh'}}
                            pagination={false}
                            size="small"
                            bordered={true} columns={[
                            {
                                title: '字段名称',
                                dataIndex: 'dbFieldName',
                                width: 150
                            },
                            {
                                title: '字段备注',
                                dataIndex: 'comment',
                                width: 150
                            },
                            {
                                title: '表单显示',
                                width: 50,
                                dataIndex: 'showForm',
                                render: (value, record, index) => {
                                    return <Checkbox checked={value}
                                                     onChange={this.checkBoxChange.bind(this, index, 'showForm')}/>
                                }
                            },
                            {
                                title: '列表显示',
                                width: 50,
                                dataIndex: 'showList',
                                render: (value, record, index) => {
                                    return <Checkbox checked={value}
                                                     onChange={this.checkBoxChange.bind(this, index, 'showList')}/>
                                }
                            },
                            {
                                title: '详情显示',
                                width: 50,
                                dataIndex: 'showInfo',
                                render: (value, record, index) => {
                                    return <Checkbox checked={value}
                                                     onChange={this.checkBoxChange.bind(this, index, 'showInfo')}/>
                                }
                            },
                            {
                                title: '是否排序',
                                width: 50,
                                dataIndex: 'sortFlag',
                                render: (value, record, index) => {
                                    return <Checkbox checked={value}
                                                     onChange={this.checkBoxChange.bind(this, index, 'sortFlag')}/>
                                }
                            },
                            {
                                title: '是否只读',
                                width: 50,
                                dataIndex: 'readOnly',
                                render: (value, record, index) => {
                                    return <Checkbox checked={value}
                                                     onChange={this.checkBoxChange.bind(this, index, 'readOnly')}/>
                                }
                            },
                            {
                                title: '控件类型',
                                dataIndex: 'fieldShowType',
                                render: (value, record, index) => {
                                    return <Select showSearch={true}
                                                   optionFilterProp="children"
                                                   value={value}
                                                   onChange={this.handleSelectChange.bind(this, index, 'fieldShowType')}
                                                   filterOption={(input, option) =>
                                                       option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
                                                   }
                                                   style={{width: '100%'}}>
                                        <Select.Option value="text">文本框</Select.Option>
                                        <Select.Option value="number">数字输入框</Select.Option>
                                        <Select.Option value="password">密码</Select.Option>
                                        <Select.Option value="radio">单选框</Select.Option>
                                        <Select.Option value="checkbox">多选框</Select.Option>
                                        <Select.Option value="select">下拉框</Select.Option>
                                        <Select.Option value="dropSearchSelect">下拉搜索</Select.Option>
                                        <Select.Option value="multiSelect">下拉多选</Select.Option>
                                        <Select.Option value="switch">开关</Select.Option>
                                        <Select.Option value="date">日期</Select.Option>
                                        <Select.Option value="datetime">日期时间</Select.Option>
                                        <Select.Option value="time">时间</Select.Option>
                                        <Select.Option value="file">文件</Select.Option>
                                        <Select.Option value="image">图片</Select.Option>
                                        <Select.Option value="popup">弹出框选择</Select.Option>
                                        <Select.Option value="dict">分类字典树</Select.Option>
                                        <Select.Option value="multiText">多行文本</Select.Option>
                                        <Select.Option value="user">用户选择</Select.Option>
                                        <Select.Option value="dept">部门选择</Select.Option>
                                        <Select.Option value="area">省市区</Select.Option>
                                    </Select>
                                }
                            },
                            {
                                title: '控件长度',
                                dataIndex: 'fieldLength',
                                render: (value, record, index) => {
                                    return <InputNumber value={value}
                                                        onChange={this.onGridNumberInputChange.bind(this, index, 'fieldLength')}/>
                                }
                            },
                            {
                                title: '是否查询',
                                dataIndex: 'query',
                                render: (value, record, index) => {
                                    return <Checkbox checked={value}
                                                     onChange={this.checkBoxChange.bind(this, index, 'query')}/>
                                }
                            },
                            // {
                            //     title: '查询类型',
                            //     dataIndex: 'address',
                            // },
                            // {
                            //     title: '控件默认值',
                            //     dataIndex: 'address',
                            // },
                            {
                                title: <Space>
                                    <div>扩展参数</div>
                                    <Popover content={'{"data":[{"name":"符合","value":1},{"name":"不符合","value":0}]}'} title="扩展参数示例">
                                        <a>示例</a>
                                    </Popover>
                                </Space>,
                                minWidth: 280,
                                dataIndex: 'fieldExtendJson',
                                render: (value, record, index) => {
                                    return <Input value={value}
                                               onChange={this.onGridInputChange.bind(this, index, 'fieldExtendJson')}/>
                                }
                            }
                        ]} dataSource={fields}/>
                    </Tabs.TabPane>
                    <Tabs.TabPane tab="校验字段" key="3">
                        <Table bordered={true}
                               pagination={false}
                               size="small"
                               scroll={{y: '25vh'}}
                               columns={[
                                   {
                                       title: '字段名称',
                                       dataIndex: 'dbFieldName',
                                       width: 150
                                   },
                                   {
                                       title: '字段备注',
                                       dataIndex: 'comment',
                                       width: 150
                                   },
                                   {
                                       title: '验证规则',
                                       dataIndex: 'fieldValidType',
                                       render: (value, record, index) => {
                                           return <Select showSearch={true}
                                                          optionFilterProp="children"
                                                          value={value}
                                                          onChange={this.handleSelectChange.bind(this, index, 'fieldValidType')}
                                                          filterOption={(input, option) =>
                                                              option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
                                                          }
                                                          style={{width: '100%'}}>
                                               <Select.Option value="notnull">非空</Select.Option>
                                               <Select.Option value="6number">6到16位数字</Select.Option>
                                               <Select.Option value="6character">6到16位任意字符</Select.Option>
                                               <Select.Option value="mobile">手机号码</Select.Option>
                                               <Select.Option value="letter">字母</Select.Option>
                                               <Select.Option value="number">数字</Select.Option>
                                               <Select.Option value="integer">整数</Select.Option>
                                               <Select.Option value="money">金额</Select.Option>
                                               <Select.Option value="url">url</Select.Option>
                                               <Select.Option value="email">电子邮件</Select.Option>
                                           </Select>
                                       }
                                   },
                                   {
                                       title: '校验必填',
                                       dataIndex: 'fieldMustInput',
                                       width: 50,
                                       render: (value, record, index) => {
                                           return <Checkbox checked={value}
                                                            onChange={this.checkBoxChange.bind(this, index, 'fieldMustInput')}/>
                                       }
                                   },
                                   {
                                       title: '字典Table',
                                       dataIndex: 'dictTable',
                                       render: (value, record, index) => {
                                           return <Input value={value}
                                                         onChange={this.inputChange.bind(this, index, 'dictTable')}/>
                                       }
                                   },
                                   {
                                       title: '字典Code',
                                       dataIndex: 'dictField',
                                       render: (value, record, index) => {
                                           return <Input value={value}
                                                         onChange={this.inputChange.bind(this, index, 'dictField')}/>
                                       }
                                   },
                                   {
                                       title: '字典Text',
                                       dataIndex: 'dictText',
                                       render: (value, record, index) => {
                                           return <Input value={value}
                                                         onChange={this.inputChange.bind(this, index, 'dictText')}/>
                                       }
                                   },
                                   {
                                       title: '字典Value',
                                       dataIndex: 'dictValue',
                                       render: (value, record, index) => {
                                           return <Input value={value}
                                                         onChange={this.inputChange.bind(this, index, 'dictValue')}/>
                                       }
                                   },
                                   {
                                       title: '字典Text赋值字段',
                                       dataIndex: 'dictTextAssignField',
                                       render: (value, record, index) => {
                                           return <Input value={value}
                                                         onChange={this.inputChange.bind(this, index, 'dictTextAssignField')}/>
                                       }
                                   }
                               ]} dataSource={fields}/>
                    </Tabs.TabPane>
                    <Tabs.TabPane tab="外键" key="4">
                        <Table
                            pagination={false}
                            bordered={true} columns={[
                            {
                                title: '字段名称',
                                dataIndex: 'dbFieldName',
                            },
                            {
                                title: '字段备注',
                                dataIndex: 'comment',
                            },
                            {
                                title: '主表名',
                                dataIndex: 'mainTable',
                                render: (value, record, index) => {
                                    return <Input value={value}
                                                  onChange={this.inputChange.bind(this, index, 'mainTable')}/>
                                }
                            },
                            {
                                title: '主表字段',
                                dataIndex: 'mainField',
                                render: (value, record, index) => {
                                    return <Input value={value}
                                                  onChange={this.inputChange.bind(this, index, 'mainField')}/>
                                }
                            }

                        ]} dataSource={fields}/>
                    </Tabs.TabPane>
                    {/*<Tabs.TabPane tab="查询配置" key="4">*/}
                    {/*    <Table*/}
                    {/*        pagination={false}*/}
                    {/*        bordered={true} columns={[*/}
                    {/*        {*/}
                    {/*            title: '字段名称',*/}
                    {/*            dataIndex: 'dbFieldName',*/}
                    {/*        },*/}
                    {/*        {*/}
                    {/*            title: '字段备注',*/}
                    {/*            dataIndex: 'comment',*/}
                    {/*        },*/}
                    {/*        {*/}
                    {/*            title: '控件类型',*/}
                    {/*            dataIndex: 'queryShowType',*/}
                    {/*            render: (value, record, index) => {*/}
                    {/*                return <Select showSearch={true}*/}
                    {/*                               optionFilterProp="children"*/}
                    {/*                               value={value}*/}
                    {/*                               onChange={this.handleSelectChange.bind(this, index, 'queryShowType')}*/}
                    {/*                               filterOption={(input, option) =>*/}
                    {/*                                   option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0*/}
                    {/*                               }*/}
                    {/*                               style={{width: '100%'}}>*/}
                    {/*                    <Select.Option value="text">文本框</Select.Option>*/}
                    {/*                    <Select.Option value="password">密码</Select.Option>*/}
                    {/*                    <Select.Option value="dropdown">下拉框</Select.Option>*/}
                    {/*                    <Select.Option value="radio">单选框</Select.Option>*/}
                    {/*                    <Select.Option value="checkbox">多选框</Select.Option>*/}
                    {/*                    <Select.Option value="switch">开关</Select.Option>*/}
                    {/*                    <Select.Option value="date">日期</Select.Option>*/}
                    {/*                    <Select.Option value="datetime">日期时间</Select.Option>*/}
                    {/*                    <Select.Option value="file">文件</Select.Option>*/}
                    {/*                    <Select.Option value="image">图片</Select.Option>*/}
                    {/*                    <Select.Option value="multiText">多行文本</Select.Option>*/}
                    {/*                    <Select.Option value="dropSelect">下拉多选</Select.Option>*/}
                    {/*                    <Select.Option value="dropSearchSelect">下拉搜索</Select.Option>*/}
                    {/*                    <Select.Option value="dict">分类字典树</Select.Option>*/}
                    {/*                    <Select.Option value="dept">部门选择</Select.Option>*/}
                    {/*                    <Select.Option value="user">用户选择</Select.Option>*/}
                    {/*                    <Select.Option value="area">省市区</Select.Option>*/}
                    {/*                </Select>*/}
                    {/*            }*/}
                    {/*        },*/}
                    {/*        {*/}
                    {/*            title: '字段Table',*/}
                    {/*            dataIndex: 'queryDictTable',*/}
                    {/*        },*/}
                    {/*        {*/}
                    {/*            title: '字段Code',*/}
                    {/*            dataIndex: 'queryDictField',*/}
                    {/*        },*/}
                    {/*        {*/}
                    {/*            title: '字段Text',*/}
                    {/*            dataIndex: 'queryDictText',*/}
                    {/*        },*/}
                    {/*        {*/}
                    {/*            title: '默认值',*/}
                    {/*            dataIndex: 'queryDefVal',*/}
                    {/*        },*/}
                    {/*        {*/}
                    {/*            title: '是否启用',*/}
                    {/*            dataIndex: 'queryConfigFlag',*/}
                    {/*        }*/}
                    {/*    ]} dataSource={fields}/>*/}
                    {/*</Tabs.TabPane>*/}
                </Tabs>
            </div>
        )
    }


    columns = [
        {
            title: '字段名称',
            dataIndex: 'dbFieldName',
            render: (value, record, index) => {
                return <Input value={value}
                              onChange={this.onGridInputChange.bind(this, index, 'dbFieldName')}/>
            }
        },
        {
            title: '字段备注',
            dataIndex: 'comment',
            render: (value, record, index) => {
                return <Input value={value}
                              onChange={this.onGridInputChange.bind(this, index, 'comment')}/>
            }
        },
        {
            title: '字段长度',
            dataIndex: 'dbLength',
            render: (value, record, index) => {
                return <InputNumber value={value}
                                    onChange={this.onGridNumberInputChange.bind(this, index, 'dbLength')}/>
            }
        },
        {
            title: '小数点',
            dataIndex: 'dbPointLength',
            render: (value, record, index) => {
                return <InputNumber value={value}
                                    min={0}
                                    onChange={this.onGridNumberInputChange.bind(this, index, 'dbPointLength')}/>
            }
        },
        {
            title: '默认值',
            dataIndex: 'dbDefaultVal',
            render: (value, record, index) => {
                return <Input value={value}
                              onChange={this.onGridInputChange.bind(this, index, 'dbDefaultVal')}/>
            }
        },
        {
            title: '字段类型',
            dataIndex: 'fieldType',
            render: (value, record, index) => {
                return <Select showSearch={true}
                               optionFilterProp="children"
                               value={value}
                               onChange={this.handleSelectChange.bind(this, index, 'fieldType')}
                               filterOption={(input, option) =>
                                   option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
                               }
                               style={{width: '100%'}}>
                    <Select.Option value="String">String</Select.Option>
                    <Select.Option value="Integer">Integer</Select.Option>
                    <Select.Option value="Long">Long</Select.Option>
                    <Select.Option value="Double">Double</Select.Option>
                    <Select.Option value="java.util.Date">java.util.Date</Select.Option>
                    <Select.Option value="BigDecimal">BigDecimal</Select.Option>
                    <Select.Option value="Text">Text</Select.Option>
                </Select>
            }
        },
        {
            title: '允许空值',
            width: 50,
            dataIndex: 'dbIsNull',
            render: (value, record, index) => {
                return <Checkbox checked={value}
                                 onChange={this.checkBoxChange.bind(this, index, 'dbIsNull')}/>
            }
        },
        {
            title: '操作',
            width: 100,
            fixed: 'right',
            render: (value, record, index) => {
                return (
                    <Space size="middle">
                        <a onClick={this._delItem.bind(this, record)}>删除</a>
                    </Space>
                )
            }
        }
    ]

}







